package utils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Iterator;

import bean.Chat;

/**
 * Created by Administrator on 2017/3/19.
 */

public class getAffairUtils {
    public static ArrayList<Chat> getchat(JSONObject jsonArray){
        ArrayList<Chat> list=new ArrayList<>();
        Iterator it=jsonArray.keys();
        while (it.hasNext()){
            try {
                String ss= (String) it.next();
                JSONObject ob= (JSONObject) jsonArray.get(ss);
                System.out.println(ss+":"+ob.getString("content"));
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
        return list;
    }
}
